            <div id="info-bar-small">Gestione articoli</div> 
            <div id="main"> 
<?php
        if(!isset($_SESSION['utente'])){ 
                exit("Accesso negato"); 
        }
        else {
                include './includes/connect.php';
                $articoli_fetchati = 0;
                $count = mysql_query("SELECT COUNT(id) FROM articoli");
                $res_count = mysql_fetch_row($count);
                $tot_records = $res_count[0];
                $per_page = 5;
                $tot_pages = ceil($tot_records / $per_page);
                $current_page = (!$_GET['page']) ? 1 : (int)$_GET['page'];
                $primo = ($current_page - 1) * $per_page;
                $query_limit = mysql_query("SELECT * FROM articoli ORDER BY id DESC LIMIT $primo, $per_page");
                $result = mysql_query($sql,$conn) or die ("Errore: ".mysql_error());
?>
                <div id="link-display">
                    <dl>
<?php
                while($row = mysql_fetch_assoc($query_limit)) {
                    $articoli_fetchati++;
                    $art_id = $row['id'];
                    $conta = "SELECT COUNT(com_id) as conta from commenti WHERE com_art = '{$art_id}'";
                    $conto = @mysql_query ($conta);
                    $tot = @mysql_fetch_array ($conto);
?>
                        <dt><h1 class="post-title"><?=$row['titolo'];?></h1></dt>
                            <dd><?=substr($row['articolo'],0,200) . ' . . .';?></dd><br />
                        <a href="./revise_post.php?id=<?=$row['id'];?>">Modifica</a> |
                        <a href="./includes/delete_post.php?id=<?=$row['id'];?>" onclick="return confirm('Eliminare definitivamente l\'articolo?')"> Elimina</a><br /><br />
                        
<?php                         
                }
        }
    if ($articoli_fetchati==0){
        echo "Non non sono presenti articoli nel database.";
?>
    <a href="new_post.php">Fai click qui</a> per scriverne uno.
<?php   
    }
?>
                    </dl>
                </div>
            </div>
            <div id="paginazione">
<?php
    include("pagina.php");
    echo "$paginazione";
?>
            </div>